$(document).ready(function(){
    var box_status="close" ;
    var card_status="login" ;
    $(".sakura").click(function () {
        $(".sakura").toggleClass("float-Sakura").toggleClass("wrench-use") ;
        $(".light-bg").toggleClass("scale-Sakura") ;
    }) ;
    $(".premise").click(function () {
        $(".canvas1").addClass("hiddenToTop") ;
        $(".canvas2").addClass("hiddenToBottom") ;
        $("main").addClass("main-show") ;
        $(".box").addClass("box-show") ;
    }) ;
    $(".box").click(function () {
        if ("close"==box_status) {
            $(".box").addClass("box-change") ;
            $(".card").addClass("card-login-change") ;
            $(".card-fake").addClass("card-fake-change") ;
            $(".box").append("<style>.box::before,.box::after{display:none}.box:hover{box-shadow: 0px 0px 6px trasparent ;}</style>");
            $(".glass").css("display","none") ;
            $("form").addClass("form-show") ;
            box_status="open" ;
        } else {}
    }) ;
    $(".card").click(function (e) {
        let x = e.clientX - $(".card").offset().left ;
        let y = e.clientY - $(".card").offset().top ;
        //console.log($(".card").offset().left+":"+$(".card").offset().top) ;
        let ripples = document.createElement('span') ;
        ripples.style.left = x+"px" ;
        ripples.style.top = y+"px" ;
        this.appendChild(ripples) ;
        setTimeout(()=> {
            ripples.remove() ; 
        },1000) ;
        if ("login"==card_status) {
            $(".card").removeClass("card-login-change") ;
            $(".card").addClass("card-regis-change") ; 
            $(".login-form").css("z-index","-1") ;
            $(".regis-form").css("z-index","0") ;
            $("form").addClass("form-move") ;
            card_status="regis" ;
            $(".card-title").text("-注冊-");
            $(".discript").html("淑慎尔止，不愆于仪。<br>投我以桃，报之以李。");
        } else {
            $(".card").addClass("card-login-change") ;
            $(".card").removeClass("card-regis-change") ; 
            $(".login-form").css("z-index","0") ;
            $(".regis-form").css("z-index","-1") ;
            $("form").removeClass("form-move") ;
            card_status="login" ;
            $(".card-title").text("-登錄-");
            $(".discript").html("西窗下，風搖翠竹，疑是故人來。<br>過眼年華，動人幽意，相逢幾番春換。");
        }
    }) ;
});

function toR0(str) { 
    //定义密钥
    var key = "0123456789while(~scanf!=EOF)";
    var len = key.length;  
    var a = key.split(""); 
    var s = "",b, b1, b2, b3;  
    for (var i = 0; i <str.length; ++i) {  
        b = str.charCodeAt(i);  //获取Unicode编码值
        b1 = b % len; 
        b = (b - b1) / len; 
        b2 = b % len; 
        b = (b - b2) / len; 
        b3 = b % len;  
        s += a[b3] + a[b2] + a[b1];  //映射到密钥
    }
    return s;  
} 

function fromR0(str) {
    var key = "0123456789while(~scanf!=EOF)";
    var len = key.length; 
    var b, b1, b2, b3, d = 0, s;  
    s = new Array(Math.floor(str.length / 3));  //计算循环节数
    b = s.length;
    for (var i = 0; i < b; ++i) {  //以循环节遍历
        b1 = key.indexOf(str.charAt(d));  
        d ++;
        b2 = key.indexOf(str.charAt(d));  
        d ++;
        b3 = key.indexOf(str.charAt(d));  
        d ++;
        s[i] = b1 * len * len + b2 * len + b3 
    }
    b = eval("String.fromCharCode(" + s.join(',') + ")");
    return b ; 
}
function myCount(o){
    var t = typeof o;
    if(t == 'string'){
            return o.length;
    }else if(t == 'object'){
            var n = 0;
            for(var i in o){
                n++;
            }
            return n;
    }
    return false;       
}
var auth_code = [
    {"tip":"简单输入","pro":"while(scanf(\"%d\",&n)){}","ans":"04703n03f03E03s01i04e04303(03l03F03c01i01601903~01601~01w03F01l01l04h04l04703n03f03E03s01i04303(03l03F03c01i01601903~01601~01w03F01l01502502l02=02e01l04h04l04703n03f03E03s01i04303(03l03F03c01i01601903~01601~01w03F01l01502501s01f01l04h04l"},
    {"tip":"万能头","pro":"#include <>","ans":"01703f03F03(03E04503~03s01402403e03f04404301a04304403~03(01(01(01c03n026"}
];
    
